var factor = Math.max(Math.min(xFactor,yFactor,Utils.IMAGE_SCALING_CONSTS.MAX_THUMBNAIL_SCALING_FACTOR),Utils.IMAGE_SCALING_CONSTS.MIN_THUMBNAIL_SCALING_FACTOR);
var width = Math.round(image.width * factor);
var height = Math.round(image.height * factor);
var t = (targetHeight - height)/2;
var l = (targetWidth - width)/2;
Prototype.E.setStyle(imgNode,{
width: width + "px",
height: height + "px",
position: "absolute",
top: t + "px",
left: l + "px"});
imgNode.width = width;
imgNode.height = height;
},
toISO8601DateString: function(date) {
var du = date.getTime();
du += date.getTimezoneOffset()*60000;
var ms = date.getUTCMilliseconds();
return (new Date(du)).toLocaleFormat(Utils.ISO8601_DATE_FORMAT) + "." + ms + "Z";
},
parseISO8601Date: function(dateString) {
var match = Utils.ISO8601_DATE_PATTERN.exec(dateString);
if (match === null) {
return null;
}
var year = parseInt(match[1], 10);
var month = parseInt(match[2], 10) - 1;
var day = parseInt(match[3], 10);
var hour = parseInt(match[4], 10);
var minute = parseInt(match[5], 10);
var second = parseInt(match[6], 10);
var milli = 0;
if (match[7]) {
milli = parseInt(match[7], 10);
}
var tzSign = "+";
var tzHour = 0;
var tzMinute = 0;
if (match[8] != "Z") {
tzSign = match[9];
tzHour = parseInt(match[10], 10);
tzMinute = parseInt(match[11], 10);
}
var d = Date.UTC(year, month, day, hour, minute, second, milli);